From: Florian Müllner Date: Thu, 14 Mar 2013 15:37:40 +0000 (+0100) Subject: screenShield: Only release logind inhibitor on suspend X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4470 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4b3bf05aaf66d4033d3261952072a72283ffc489;p=gnome-shell.git screenShield: Only release logind inhibitor on suspend To make sure that the screen shield is shown before suspending, we take a logind inhibitor and release it when the screen shield is shown. As the screen shield is not only shown on suspend, we can end up releasing the inhibitor independently from suspending (lock, idle), in which case the screen might not be locked when we do suspend. To fix, only release the inhibitor after showing the screen shield when we are about to suspend. https://bugzilla.gnome.org/show_bug.cgi?id=693708 --- diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index f2a1ceac7..3c8dd6ea0 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -502,6 +502,7 @@ const ScreenShield = new Lang.Class({ this._screenSaverDBus = new ShellDBus.ScreenSaverDBus(this); this._inhibitor = null; + this._aboutToSuspend = false; this._loginManager = LoginManager.getLoginManager(); this._loginManager.connect('prepare-for-sleep', Lang.bind(this, this._prepareForSleep)); @@ -644,6 +645,8 @@ const ScreenShield = new Lang.Class({ }, _prepareForSleep: function(loginManager, aboutToSuspend) { + this._aboutToSuspend = aboutToSuspend; + if (aboutToSuspend) { if (!this._settings.get_boolean(LOCK_ENABLED_KEY)) { this._uninhibitSuspend(); @@ -999,7 +1002,8 @@ const ScreenShield = new Lang.Class({ if (prevIsActive != this._isActive) this.emit('active-changed'); - this._uninhibitSuspend(); + if (this._aboutToSuspend) + this._uninhibitSuspend(); this.emit('lock-screen-shown'); },